import requests from "@/api/requests"

import mockRequests from '@/api/mockAjax'

export const reqCateGoryList = ()=> requests({url:'/api/product/getBaseCategoryList',method:'get'});

export const reqGetBannerList = ()=> mockRequests({url:'/banner',method:'get'});

export const reqFloorList = ()=> mockRequests({url:'/floor',method:'get'});

//请求搜索栏数据
export const reqGetSearchInfo = (params)=>requests({url:"/api/list",method:"post",data:params})
//请求搜索页面的分页数据
export const reqGoodsInfo = (skuId) =>requests({url:`/api/item/${skuId}`,method:'get'})

export const reqAddOrUpdateShopCart = (skuId,skuNum)=>requests({url:`/api/cart/addToCart/${skuId}/${skuNum}`,method:"post"})

export const reqCartList = () =>requests({url:'/api/cart/cartList',method:'get'})

export const reqGetCode = (phone)=>requests({url:`/api/user/passport/sendCode/${phone}`,method:'get'})

export const reqUserRegister =(data) =>requests({url:'/api/user/passport/register',data,method:'post'})



export const reqUserLogin = (data) =>requests({url:`/api/user/passport/login`,data,method:'post'})


export const reqUserInfo = () =>requests({url:'/api/user/passport/auth/getUserInfo',method:'get'})

export const reqLogOut = () =>requests({url:'/api/user/passport/logout',method:'get'})

export const reqOrderInfo = ()=>requests({url:'/api/order/auth/trade',method:'get'})

export const reqAddressInfo = () =>requests({url:'/api/user/userAddress/auth/findUserAddressList',method:'get'})

export const reqSubmitOrder = (tradeNo,data)=>requests({url:`/api/order/auth/submitOrder?tradeNo=${tradeNo}`,data,method:'post'})

export const reqPayInfo =(orderId)=> requests({url:`/api/payment/weixin/createNative/${orderId}`,method:'get'})

export const reqPayStatus = (orderId) => requests({url:`/api/payment/weixin/queryPayStatus/${orderId}`,menubar:'get'})

export const reqMyList = (page,limit)=>requests({url:`/api/order/auth/${page}/${limit}`,method:'get'});